package com.hotkid.ceo.jetpack.myjetpackmvvm.data.http

import com.hotkid.ceo.jetpack.myjetpackmvvm.base.BaseBean
import com.hotkid.ceo.jetpack.myjetpackmvvm.data.bean.User
import retrofit2.http.Field
import retrofit2.http.FormUrlEncoded
import retrofit2.http.POST

/**
 * ClassName:Api
 * Package:com.hotkid.ceo.jetpack.myjetpackmvvm.data.http
 * Description:
 * @date:2021/3/19 4:05 PM
 * @author:774169396@qq.com
 */
interface Api {
    companion object{
        const val BASE_URL="https://www.wanandroid.com/"
    }


    //------------------------------[登录注册]---------------------------
    //登录
    @FormUrlEncoded
    @POST("user/login")
    suspend fun login(
            @Field("username") username:String?,
            @Field("password") password:String?
    ):BaseBean<User>

    //注册
    @FormUrlEncoded
    @POST("user/register")
    suspend fun register(
            @Field("username") username:String?,
            @Field("password") password:String?,
            @Field("repassword") repassword:String?
    ):BaseBean<User>
}